<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              height="500">
      <el-table-column prop="dealSerialNumber"
                       label="交易流水号"
                       align="center">
      </el-table-column>
      <el-table-column prop="username"
                       label="用户"
                       align="center">
      </el-table-column>
      <el-table-column prop="transactionAmount"
                       label="交易金额"
                       align="center">
      </el-table-column>
      <el-table-column prop="source"
                       label="来源"
                       align="center">
      </el-table-column>
      <el-table-column prop="paymentMethod"
                       label="支付方式"
                       align="center">
      </el-table-column>
      <el-table-column prop="transactionStatus"
                       label="交易状态"
                       align="center">
      </el-table-column>
      <el-table-column prop="tradingTime"
                       label="交易时间"
                       align="center">
      </el-table-column>
    </el-table>

     <!-- 分页组件 -->
    <!-- <Pagination :child-msg="pageparm" @callFather="callFather" align="center"/> -->
  </div>
</template>

<script>
// import Pagination from "../Pagination";
export default {
  //接收父组件传递的数据
//   components: {Pagination},
  data () {
    return {
      pageNum: 1,
      pageSize: 5,
      total: 0,
      tableData: [],
      // 初始化分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 5,
        total: 0,
      },
    }
  },
  
  //创建完毕
  mounted() {
    // 获取表单数据
    this.getsuccess();
    // this.tableData = localStorage.getItem("successData");
  },

  methods: {
    //获取表单数据
    getsuccess(){
        this.$axios.get("/finance/deal/")
        .then((res) => {
            if(res.data.code == 200){
                console.log(res.data)
                this.tableData = res.data.data;
                this.pageparm.total = res.data.data.total;
            }else{
                this.$message({type: 'info',message: res.data.message})
            }
        })
        // .catch(err => {
        //     this.$message.error('数据加载失败，请稍后再试！')
        // })
    },
    // 分页插件事件
    callFather(parm) {
      this.pageparm.currentPage = parm.currentPage;
      this.pageparm.pageSize = parm.pageSize;
      this.getdata();
    },
  }
}
</script>

<style scoped>
</style>
